<?php
/**
 * $Id: city.php 99 2009-01-28 12:53:21Z gpo_shrey $
 * 
 * This file can not be redistributed to anyone without the permission of Giga Promoters
 * Copyright 2005 - 2008, Giga Promoters
 * 						  608 Aggarwal Cyber Plaza
 *						  Netaji Subhash Place, Delhi - 110034
 *						  www.gigapromoters.com
 * 
 *
 * This is parent of parent class of a controller and should not be edited ever without permission.
 * @version 			$Rev: 99 $
 * @lastModifiedBy		$LastChangedBy: gpo_shrey $
 * @lastChanged			$Date: 2009-01-28 18:23:21 +0530 (Wed, 28 Jan 2009) $
 * @copyright 			Giga Promoters (www.gigapromoters.com)
 * 
 */

/**
 * World cities database with countries.
 *
 */
class City extends CmsAppModel
{
	var $name = 'City';

	function recommend($query, $limit=10)
	{
		return $this->find('all',array('conditions'=>'City.city like "'.$query.'%"','limit'=>$limit,'group'=>'city'));
	}

	function afterFind($results)
	{
		foreach ($results as $key => $val) 
		{
			$results[$key]['City']['country'] = Utility::getCountry($results[$key]['City']['country_code']);
		}
		return $results;
	}


}

?>